Introduction
Create videos with templates, where you can customize your own text, images, videos, and Script content.
Quick Start
Prerequisite
Procedure
-
Creating Template through the Interface.
-
Define the replaceable elements in the template.
-
Modify Template Elements and Generate Video.
Step 1: Creating Template through the Interface
Create your own templates in the user interface
There are two types of templates. One is in the public library, and the other is created by individuals.
The templates created by yourself can be directly copied with their IDs.
Obtain the list of templates
You can also obtain the template_id you need by getting the list of templates.
Get My Templates
Through the following request, you can get the templates that you created yourself.
curl --request GET \
--url 'https://api.jogg.ai/v1/templates/custom' \
--header 'x-API-key: <API-key>'
--header 'Content-Type: application/json'
Step 2: Define the replaceable elements in the template.
On the interface, define variables.
You can customize variable names for the elements in the template to facilitate your identification and replacement of them.
Tip: Currently, only script content, text, image, video and avatar
are supported.
Step 3: Modify Template Elements and Generate Video.
Pass the parameters for generating the video to the template, and it will return a generated video_ID
.
curl --location --request POST \
--url 'https://api.jogg.ai/v1/create_video_with_template' \
--header 'x-API-key: <your-API-key>' \
--header 'Content-Type: application/json'
--data-raw '{
"template_id": 0, // required;
"template_type": "user", // required;Template type; default is "user";
"avatar_id": 0, // required;Digital person ID;
"avatar_type": 0, // required;Determine the source of the avatar, whether it is in a public library or created by an individual
"lang": "english" // required;t
"variables": [
{
"type": "text",
"name": "Text_element", // Name of the variable to be replaced as set in the template
"properties": {
"content": "test"
},
},
{
"type": "image",
"name": "image_name",
"properties": {
"url": "<your-image-url>" // "https://res.jogg.ai/image_name.jpg"
}
},
{
"type": "video",
"name": "video_name",
"properties": {
"url": "<your-video-url>" // "https://res.jogg.ai/video_name.mp4"
}
},
{
"type": "script",
"name": "script_en",
"properties": {
"content": "script_content"
}
}
]
}
Replace Text / Image / Video / in Template
How to replace the text, images and videos in the template.
Relevant parameters
Text Properties:
Image Properties:
url:
URL of the image content.
Video Properties:
url:
URL of the video content.
Example
Define the variable.
Modify Template Elements and Generate Video.
curl --location --request POST \
--url 'https://api.jogg.ai/v1/create_video_with_template' \
--header 'x-API-key: <your-API-key>' \
--header 'Content-Type: application/json'
--data-raw '{
"template_id": 0, // required;
"template_type": "user", // required;Template type; default is "user"
"avatar_id": 0, // required;Digital person ID;
"avatar_type": 0, // required;Determine the source of the avatar, whether it is in a public library or created by an individual
"lang": "english" // required;The language;
"variables": [
{
"type": "text",
"name": "Text_element", // Name of the variable to be replaced as set in the template
"properties": {
"content": "test"
}
},
{
"type": "image",
"name": "image_name",
"properties": {
"url": "<your-image-url>" // "https://res.jogg.ai/image_name.jpg"
}
},
{
"type": "video",
"name": "video_name",
"properties": {
"url": "<your-video-url>" // "https://res.jogg.ai/video_name.mp4"
}
}
]
}
Replace Script content in Template
How to replace the scripts content within the template.
Relevant parameters
Script Properties:
Example
Define the variable.
Modify Template Elements and Generate Video.
curl --location --request POST \
--url 'https://api.jogg.ai/v1/create_video_with_template' \
--header 'x-API-key: <your-API-key>' \
--header 'Content-Type: application/json'
--data-raw '{
"template_id": 0, // required;
"template_type": "user", // required;Template type; default is "user";
"avatar_id": 0, // required;Digital person ID;
"avatar_type": 0, // required;Determine the source of the avatar, whether it is in a public library or created by an individual
"lang": "english" // required;The language;
"variables": [
{
"type": "script",
"name": "script_en",
"properties": {
"content": "script_content"
}
}
]
}
Replace Avatar in Template
How to replace the Avatar within the template.
Relevant parameters
Avatar Properties:
Example
Modify the Avatar ID and Generate Video.
curl --location --request POST \
--url 'https://api.jogg.ai/v1/create_video_with_template' \
--header 'x-API-key: <your-API-key>' \
--header 'Content-Type: application/json'
--data-raw '{
"template_id": 0, // required;
"template_type": "user", // required;Template type; default is "user";
"avatar_id": 0, // required;Set the corresponding avatar ID;
"avatar_type": 0, // required;Determine the source of the avatar, whether it is in a public library or created by an individual
"lang": "english" // required;The language;
}
Callout Content.
We also have a feature that we don’t recommend to use very often: adding a tag to the script to implement pause in the video editor. It allows you to silence your video for a set amount of time.
Add a pause to the script with <break time=\"2s\" />.
curl --location --request POST \
--url 'https://api.jogg.ai/v1/create_video_with_template' \
--header 'x-api-key: <your-API-key>' \
--data '{
"template_id": 0, // required;
"template_type": "user", // required;Template type; default is "user";
"avatar_id": 0, // required;Set the corresponding avatar ID;
"avatar_type": 0, // required;Determine the source of the avatar, whether it is in a public library or created by an individual
"lang": "english", // required;The language;
"variables": [
{
"type": "script",
"name": "script_en",
"properties": {
"content": "<break time=\"2s\" />" // Add a pause
}
}
]
}'